import { createApp } from 'vue'
// import './assets/css/vantIndex.css';
import App from './App.vue'
import './index.css'
import sdk from './wxsdk/sdk.js' //引入sdk.js
// const setting = require("./setting")
import router from './router/index.js'
import store from './store/index.js'
import { NavBar, Tabbar, TabbarItem, Uploader ,Field ,Loading} from "vant"
createApp(App).use(router).use(Loading).use(store).use(NavBar).use(TabbarItem).use(Field).use(Tabbar).use(Uploader).mount('#app')

router.beforeEach((to, from, next) => {
    // if (to.path == '/match/detail/MatchDetailGoing' || to.path == '/have' || to.path == '/match/apply') {
    //     if (to.path == '/match/detail/MatchDetailGoing') {
    //         let url = window.location.href.split('#')[0];
    //         let obj = {
    //             title: 'TISSYS-网球赛事服务系统', //分享标题
    //             desc: '专业、高效、稳定的赛事一体化智能软件服务系统，旨在为赛事各参与方提供的全流程一体化智能解决方案。', //分享内容
    //             linkurl: location.protocol + '//' + location.host + '/mobile/#' + window.location.href.split('#')[1], //分享链接
    //             img: 'http://www.tissys.com/default_logo.png' //分享内容显示的图片
    //         }
    //         sdk.getJSSDK(url, obj) //传入sdk.js需要的参数
    //     }
    //     next()
    // } else {
        
    let url = "http://photobook.zhongaotech.com/#/";
        // let url = window.location.href.split('#')[0];
        let obj = {
            title: '2021年“书香校园”——图说书香', //分享标题
            desc: '庆祝中国共产党成立100周年，洪山区教育系统“学四史、知国情、跟党走”，2021年“书香校园”——图说书香。', //分享内容
            // linkurl: location.protocol + '//' + location.host+ "/#" + window.location.href.split('#')[1], //分享链接
            // linkurl: location.protocol + '//' + location.host+ "/#" + to.fullPath, //分享链接
            linkurl: location.protocol + '//' + location.host + '/#/', //分享链接
            // linkurl: "http://photobook.zhongaotech.com", //分享链接
            img: 'http://photobook.zhongaotech.com/photo.png' //分享内容显示的图片
        }


        sdk.getJSSDK(url, obj) //传入sdk.js需要的参数
        next()
    // }
})